﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BaseSet.Data;
using BaseSet.Logic;
using BaseSet.Entity;
using BaseSet.Framework;
using BaseSet.Entity.Common;
using BaseSet.Entity.Common.Text;
using BaseSet;
using System.Data;

namespace WebSite.Admin.BlogManager
{
    public partial class BlogTypeAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #region 添加
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string blogbigtype = ddlBlogBigType.SelectedValue;
            string blogtypename = txtBlogTypeName.Text.Trim();


            if (string.IsNullOrEmpty(blogtypename))
            {
                Tools.Alert("请填写类别名称！");
                return;
            }

            BlogType btinfo = new BlogType();
            BlogTypeHelper bthelper = new BlogTypeHelper();

            btinfo.BlogBigType = blogbigtype;
            btinfo.BlogTypeName = blogtypename;
            bthelper.AddBlogType(btinfo);

            Tools.AlertAndRedirect("添加成功！", "BlogTypeManager.aspx");
        }
        #endregion

        #region 返回
        protected void ReturnBtn_Click(object sender, EventArgs e)
        {
            Response.Redirect("BlogTypeManager.aspx");
        }
        #endregion
    }
}